package com.portal.exception.controller;

import com.portal.common.response.JsonBaseResult;
import com.portal.exception.exception.AppException;
import com.portal.exception.service.RetryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 测试控制器
 *
 * @author Amadeus
 * @date 2022/07/07
 */
@Slf4j
@RestController
@RequestMapping("/lottery")
public class TestController {

    @Autowired
    private RetryService retryService;

    @GetMapping(value = "/list")
    public JsonBaseResult test() {
        throw new AppException("测试");
    }

    @GetMapping(value = "/going")
    public JsonBaseResult going(Integer code) {
        try {
            retryService.retry(code);
        } catch (Exception ignored) {

        }
        return JsonBaseResult.success();
    }


}
